package thread_learn2;

import java.util.Scanner;

public class demon7 {
    private volatile static int n=0;
    public static void main(String[] args) {

        Thread thread=new Thread(()->{
           while(n==0){

           }
        });
        Thread thread1=new Thread(()->{
            Scanner scanner=new Scanner(System.in);
            System.out.println("请输入一个整数:");
            n=scanner.nextInt();
        });
        thread.start();
        thread1.start();
    }
}
